<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>双重循环结构</title>
	<script type="text/javascript">
		var sum=0;
		var sco=0;
		var sum1=0;
		var avg=0;
		var avg1=0;
		for(i=1;i<=3;i++){
			for(j=1;j<=4;j++){
				sco=Number(prompt('请输入第'+i+'班第'+j+'位同学的成绩'));
				sum+=sco;
				sum1+=sco;
			}
			avg1=sum1/4;
			console.log(i+'班的平均分为'+avg1);
			sum1=0;
		}
		avg=sum/12;
		console.log('三个班的总平均分为'+avg);

	</script>
</head>
<body>
	
</body>
</html>